<?php
/**
 * (crontab)
 */
namespace App\Crontab\Daily;

use App\Logic\SalesAmazon\SalesAmountDaily;
use App\Logic\SalesAmazon\SalesAmountMonthly;
use App\Logic\SalesAmazon\SalesVolume;
use App\Logic\SalesAmazon\SalesVolumeMonthly;
use App\Logic\SalesReport\DailySaleVolume;

class SalesAmazonWork
{
    /**
     * 1每天运行30 8 * * * *
     * 统计亚马逊订单销量到销量表
     * @param int $days
     */
    public static function initVolume($days = 1)
    {
        SalesVolume::initPlatform($days);
    }

    /**
     * 1每天运行30 8 * * * *
     * 统计亚马逊订单销量到日销量表(每日)
     * @param int $days
     */
    public static function initDailySaleVolume($days = 1)
    {
        DailySaleVolume::initSalesVolume($days);
    }

    /**
     * 2每天运行40 8,23 * * * *
     * 统计亚马逊订单到月销售量
     */
    public static function initVolumeMonth()
    {
        SalesVolumeMonthly::init();
    }


    /**
     * 1每天运行30 8,23 * * * *
     * 统计亚马逊订单到每日销售额表
     * @param int $days
     */
    public static function initAmount($days = 7)
    {
        SalesAmountDaily::init($days);
    }

    /**
     * 2每天运行40 8,23 * * * *
     * 统计亚马逊订单到月销售额
     */
    public static function initAmountMonth()
    {
        SalesAmountMonthly::init();
    }
}
